{extend name="Base/base"/}

{block name="body"}
    <div class="main-title">
        <h2>商城基本设置            </h2>
    </div>
    <div class="with-padding">


        <div class="tab-wrap" style="margin-bottom: 5px">
            <ul class="nav nav-secondary group_nav">
            </ul>
        </div>
        <form action="/uctoo/admin.php?s=/shop/shop.html" method="post" class="form-horizontal">
            <label class="item-label">商城名称    </label>
            <div class="controls ">
                <input type="text" name="TITLE" value="" class="text input-large form-control" style="width: 400px"></div><label class="item-label">店铺logo    </label>
            <div class="controls ">
                <div class="controls">
                    <div id="upload_single_image_LOGO" style="padding-bottom: 5px;" class="webuploader-container"><div class="webuploader-pick">选择图片</div><div id="rt_rt_1b4t53n2l142t2sck671iq022j1" style="position: absolute; top: 0px; left: 0px; width: 64px; height: 28px; overflow: hidden; bottom: auto; right: auto;"><input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept="image/*"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></div></div>
                    <input class="attach" type="hidden" name="LOGO" value="">
                    <div class="upload-img-box">
                        <div class="upload-pre-item popup-gallery">

                        </div>
                    </div>
                </div>
                <script>
                    $(function () {
                        var uploader_LOGO= WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: 'Uploader.swf',
                            // 文件接收服务端。
                            server: "/uctoo/admin.php?s=/file/uploadpicture/session_id/us4q6e0illvfrr7upl0rdh23e3.html",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#upload_single_image_LOGO',
                            // 只允许选择图片文件
                            accept: {
                                title: 'Images',
                                extensions: 'gif,jpg,jpeg,bmp,png',
                                mimeTypes: 'image/*'
                            }
                        });
                        uploader_LOGO.on('fileQueued', function (file) {
                            uploader_LOGO.upload();
                        });
                        /*上传成功**/
                        uploader_LOGO.on('uploadSuccess', function (file, data) {
                            if (data.status) {
                                $("[name='LOGO']").val(data.id);
                                $("[name='LOGO']").parent().find('.upload-pre-item').html(
                                    ' <div class="each"><a href="'+ data.path+'" title="点击查看大图"><img src="'+ data.path+'"></a><div class="text-center opacity del_btn" ></div>' +
                                    '<div onclick="admin_image.removeImage($(this),'+data.id+')"  class="text-center del_btn">删除</div></div>'
                                );
                                uploader_LOGO.reset();
                            } else {
                                updateAlert(data.info);
                                setTimeout(function () {
                                    $('#top-alert').find('button').click();
                                    $(that).removeClass('disabled').prop('disabled', false);
                                }, 1500);
                            }
                        });
                    })
                </script></div><label class="item-label">公告    </label>
            <div class="controls ">
                <input type="text" name="NOTICE" value="" class="text input-large form-control" style="width: 400px"></div><label class="item-label">商城状态    <span class="check-tips">（默认正常）</span></label>
            <div class="controls ">
                <label for="id_STATUS_1"> <input id="id_STATUS_1" name="STATUS" value="1" type="radio">
                    是</label> &nbsp;&nbsp;&nbsp;&nbsp;            <label for="id_STATUS_0"> <input id="id_STATUS_0" name="STATUS" value="0" type="radio" checked="">
                否</label> &nbsp;&nbsp;&nbsp;&nbsp;</div><label class="item-label">收款公众号    </label>
            <div class="controls ">
                <select name="MP_ID" class="form-control" style="width:auto;">
                </select></div>                        <br>

            <div class="form-item">
                <button class="btn submit-btn ajax-post btn-success" id="submit" type="submit" target-form="form-horizontal">保存</button>  &nbsp;            </div>
        </form>
    </div>


</div>
{/block}

{block name="script"}
<script type="text/javascript">
    $(function () {
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮

        //点击排序
        $('.list_sort').click(function () {
            var url = $(this).attr('url');
            var ids = $('.ids:checked');
            var param = '';
            if (ids.length > 0) {
                var str = new Array();
                ids.each(function () {
                    str.push($(this).val());
                });
                param = str.join(',');
            }

            if (url != undefined && url != '') {
                window.location.href = url + '/ids/' + param;
            }
        });
    });
</script>
{/block}